package work;

import com.aliasi.matrix.CosineDistance;
import util.CosineTextSimilarity;

/**
 * @author ：hzs
 * @date ：Created in 2021/5/1 14:36
 * @description：最后一个月的工作
 * @modified By：
 * @version: $
 */
public class work4 {

    public void fun1() {
        // Grouping sentences as better language unit for extractive text summarization第一段
        String s1 = "Automatic text summarization is an important research direction in the area of natural language processing.";
        String s2 = "It is a desirable approach to deal with the rapid growth of online texts.";
        String s3 = "A good summary should convey the core ideas of the source texts fluently while minimizing the redundancy [1].";
        String s4 = "Text summarization  tasks can be classified into single-document or multi-document summarization tasks according to the number of source texts, and can be classified into generic or theme-focused (also known as query-focused) summarization tasks according to whether the summarization concerns all themes or specific themes of the source text.";
        String s5 = "Text summarization methods are generally divided into extractive and abstractive [2].";
        String s6 = "Extractive methods usually rank sentences by analyzing statistical and linguistic features such as word/phrase frequency, part-of-speech of words/phrases, position of sentence, and so on, and extract top-k ranked sentences to compose a summary [3].";
        String s7 = "Abstractive methods attempt to discover the main events (or key words/phrases) and their relations in the source text based on background lexicon and linguistic knowledge, and rephrase these main events (or key words/phrases) into new sentences with possible new words or phrases [1].";
        System.out.println(CosineTextSimilarity.getSimilarityBetweenTwoSentences(s5, s3));
        System.out.println(CosineTextSimilarity.getSimilarityBetweenTwoSentences(s5, s4));
        System.out.println(CosineTextSimilarity.getSimilarityBetweenTwoSentences(s5, s6));
        System.out.println(CosineTextSimilarity.getSimilarityBetweenTwoSentences(s5, s7));
    }

    public static void main(String[] args) {
        work4 work4 = new work4();
        work4.fun1();
    }

}
